<?php
/*
 *  WOW ITEM 菜单
 */
class Model_Dbtable_Wowmenuclass extends Zend_Db_Table_Abstract
{
    /**
     * The default table name 
     */
    protected $_name = 'db_wow_menu_class';
    
	//CLASS 菜单
	
	public function showclass($menu){
		$table = $this->getAdapter();
		$where = $table->quoteInto("menu = ?", "$menu");
		
		$query = $table->query("SELECT * FROM $this->_name WHERE $where ORDER BY id ");
		
		return $query;
	}
	
	public function classname($class){
		if ($class != "-1"){
			$classname = $this->fetchRow("class_id = '$class'");
			return $classname;
		}
	}
	
	public function classnav($url){
		$menu = new Model_Dbtable_Wowmenu();
		$menu = $menu->menuname($url)->toArray();
		$classnav = $this->fetchAll("menu = '$menu[id]'")->toArray();
		return $classnav;
	}
}
